<template>
    <div class="PrintOrder">
        <h1>打印订单</h1>
        <order status="('找书中','配送中')" :btn1="toPrint" name1="打印"/>
    </div>
</template>

<script>
    export default {
        props: {},
        data() {
            return {}
        },
        methods: {
            toPrint(item) {
                this.$axios.get('/order/detail', {params: {id: item.id}})
                    .then(res => {
                        if (res.data.code === 200) {
                            this.$router.push({
                                name: 'toPrintOrder',
                                params: {
                                    address:item.address,
                                    username: item.username,
                                    create: item.create,
                                    details: res.data.content
                                }
                            });
                        } else {
                            window.alert('查询图书失败');
                        }
                    })
            }
        }
    };
</script>
<style scoped lang="scss">
    @import "PrintOrder";

</style>
